//
//  HttpOrgAction.m
//  EPBPro
//
//  Created by wucha on 2018/6/28.
//  Copyright © 2018年 fc. All rights reserved.
//

#import "HttpOrgAction.h"

@implementation HttpOrgAction
+(void)postSearchOrgList:(NSDictionary*)dic block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionSearchOrgList parmasAndKeys:nil];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getOrgListResultWithResponseData:) finish:block];
}

+(void)postAddOrgInfo:(OrgInfo*)orgInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionAddOrg parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:orgInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getAddOrgResultWithResponseData:) finish:block];
}

+(void)deleteOrg:(NSString*)orgId block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:@"org/%@",orgId] parmasAndKeys:nil];
    [self deleteRequestWithRequest:requestString withParam:nil jsonSelector:@selector(deleteOrgResultWithResponseData:) finish:block];

}

+(void)getOrgContractList:(NSString*)orgId block:(HTTPResultBlock)block{
    NSString *url = [NSString stringWithFormat:@"%@%@",ActionOrgContract,orgId];
    NSString *requestString = [Utils getUrlWithAction:url parmasAndKeys:nil];
    [self requestWithRequest:requestString jsonParserSelector:@selector(getContractListMoreResultWithResponseData:) finish:block];
    
}

+(void)getOrgGainList:(NSString*)orgId block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:ActionOrgGain,orgId] parmasAndKeys:nil];
    [self requestWithRequest:requestString jsonParserSelector:@selector(getOrgGainListResultWithResponseData:) finish:block];

}

+(void)getOrgIntoCash:(InCashActionInfo*)inCashActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionIntoCash parmasAndKeys:nil];
    NSDictionary *params = [Utils objectToDictionary:inCashActionInfo];
    [self postRequestWithRequest:requestString withParam:params jsonSelector:@selector(getOrgIntoCashResultWithResponseData:) finish:block];
}
@end
